﻿#include "JZWebContext.h"

JZWebContext::JZWebContext()
{
}

JZWebContext::~JZWebContext()
{
}

void JZWebContext::addCommand(const JZWebCommand& cmd)
{
	m_command.push_back(cmd);
}

void JZWebContext::setProperty(int key, const QVariant& v)
{
	m_props[key] = v;
}

QVariant JZWebContext::property(int key)
{
	return m_props[key];
}

const QVector<JZWebCommand>& JZWebContext::commands() const
{
	return m_command;
}

int makeKey(int id, int prop)
{
	return id << 16 | prop;
}

void splitKey(int key, int& id, int& prop)
{ 
	id = key >> 16;
	prop = key & 0xFFFF;
}